<?php

namespace SMSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
/**
 * SMSRecord
 *
 * @ORM\Table(name="sms_record", options={"comment"="短信动态码"}, indexes={@ORM\Index(name="phone", columns={"phone"})})
 * @ORM\Entity
 */
class SMSRecord
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="phone", type="string", length=11, nullable=false, options={"comment"="手机号码"})
     */
    private $phone;

    /**
     * @var string
     *
     * @ORM\Column(name="salt", type="string", length=4, nullable=false, options={"comment"="验证码"})
     */
    private $salt;

    /**
     * @var integer
     *
     * @ORM\Column(name="happen_time", type="integer", nullable=false, options={"comment"="发送时间"})
     */
    private $happenTime;

    /**
     * @var integer
     *
     * @ORM\Column(name="type", type="smallint", nullable=false, options={"comment"="短信用途 具体类型查看文档"})
     */
    private $type;

    /**
     * @var integer
     *
     * @ORM\Column(name="times", type="smallint", nullable=false, options={"comment"="验证码验证次数"})
     */
    private $times;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_used", type="boolean", nullable=false, options={"comment"="验证码是否使用"})
     */
    private $isUsed;

    /**
     * @var string
     *
     * @ORM\Column(name="ip", type="string", length=40, nullable=false, options={"comment"="IP地址"})
     */
    private $ip;

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $id
     * @return SMSRecord
     */
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * @return string
     */
    public function getPhone()
    {
        return $this->phone;
    }

    /**
     * @param string $phone
     * @return SMSRecord
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;
        return $this;
    }

    /**
     * @return string
     */
    public function getSalt()
    {
        return $this->salt;
    }

    /**
     * @param string $salt
     * @return SMSRecord
     */
    public function setSalt($salt)
    {
        $this->salt = $salt;
        return $this;
    }

    /**
     * @return int
     */
    public function getHappenTime()
    {
        return $this->happenTime;
    }

    /**
     * @param int $happenTime
     * @return SMSRecord
     */
    public function setHappenTime($happenTime)
    {
        $this->happenTime = $happenTime;
        return $this;
    }

    /**
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * @param int $type
     * @return SMSRecord
     */
    public function setType($type)
    {
        $this->type = $type;
        return $this;
    }

    /**
     * @return int
     */
    public function getTimes()
    {
        return $this->times;
    }

    /**
     * @param int $times
     * @return SMSRecord
     */
    public function setTimes($times)
    {
        $this->times = $times;
        return $this;
    }

    /**
     * @return bool
     */
    public function isUsed()
    {
        return $this->isUsed;
    }

    /**
     * @param bool $isUsed
     * @return SMSRecord
     */
    public function setIsUsed($isUsed)
    {
        $this->isUsed = $isUsed;
        return $this;
    }

    /**
     * @return string
     */
    public function getIp()
    {
        return $this->ip;
    }

    /**
     * @param string $ip
     * @return SMSRecord
     */
    public function setIp($ip)
    {
        $this->ip = $ip;
        return $this;
    }


}
